package com.study.Util;

import com.study.modules.saas.service.BillService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @Author hupengming
 * @ClassName
 * @Date 2022-10-25 17:05
 * @Version 1.0
 */
@Slf4j
@Component
public class TestStaticUtils {
    @Autowired
    private BillService billService;
    @Value(value = "${test.name:null}")
    private String name;

    @Value(value = "${test.role:null}")
    private String role;

    private static String userName;

    private static String roleName;

    private static BillService bService;

    @PostConstruct
    public void init(){
        userName = this.name;
        roleName = this.role;
        bService = this.billService;
    }

    public static void testStatic(){
        System.out.println("userName:" + userName);
        System.out.println("roleName:" + roleName);
        System.out.println("bill:" + bService);
    }

}
